Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ellipsize pill component contents when too large #1133

Merged
merged 6 commits into from
Apr 6, 2024

Conversation

FadhlanR
Copy link
Contributor

@FadhlanR FadhlanR commented Apr 3, 2024

Screenshot 2024-04-03 at 14 06 14

@FadhlanR FadhlanR requested a review from a team April 3, 2024 07:08
Copy link

github-actions bot commented Apr 3, 2024

Test Results

576 tests  ±0   572 ✔️ ±0   8m 12s ⏱️ -2s
    1 suites ±0       4 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 4d70782. ± Comparison against base commit 4820358.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@backspace backspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s conventional when truncating to show the entire thing on hover:

Boxel 2024-04-03 08-23-28

This seems more difficult because of it being an atom format, but is it still somewhow possible?

display: flex;
max-width: 100px;
}
:deep(.atom-format) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I didn’t realise this was possible 🤩

@jurgenwerk jurgenwerk self-requested a review April 3, 2024 15:27
Copy link
Contributor

@jurgenwerk jurgenwerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree it would be very convenient to be able to see the full text when the text is truncated

get isTooltipDisplayed() {
// If card is an auto-attached card, we need to hide the tooltip
// because there is another tooltip shows "Topmost card is shared automatically".
return this._isTooltipDisplayed && !this.args.isAutoAttachedCard;
Copy link
Contributor

@jurgenwerk jurgenwerk Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There are now 2 clashing tooltips - how do you decide which one is more important?
  2. Logic got confusing because the pill component now has more context about its surroundings, for example needing to know there is another tooltip on top of it... ideally this should not be its responsibility

Have you considered what Buck suggested, a title attribute?

image

Copy link
Contributor Author

@FadhlanR FadhlanR Apr 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I didn't realize about the title attribute before. I reverted the commit regarding the tooltip and implemented title attribute instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding title in field-component I moved it to card-pill in this PR so we don't need to update field-component and keep any changes in card-pill file.

@FadhlanR FadhlanR force-pushed the ellipsize-pill-component branch from ffcf4c2 to fae4d7d Compare April 6, 2024 04:58
@FadhlanR FadhlanR merged commit 3bbcd1b into main Apr 6, 2024
18 checks passed
@delete-merged-branch delete-merged-branch bot deleted the ellipsize-pill-component branch April 6, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants